<template class="content">
	<view>
		<view class="top">
			<p>{{score}}可用积分</p>
			<view class="integral" @click="goRule">
				积分规则
			</view>
		</view>
		<view class="danyuan">
			<view class="cells" @click="godeel">
				<view>
					<image src="../../static/qian.png" mode="" class="images"></image>
					<p class="textA">交易记录</p>
				</view>
				<image src="../../static/向右箭头.png" mode=""></image>
			</view>
			<view class="cells" @click="goTransaction">
				<view>
					<image src="../../static/liwu.png" mode="" class="images"></image>
					<p class="textA">积分兑换</p>
				</view>
				<image src="../../static/向右箭头.png" mode=""></image>
			</view>
			<view class="cells"  @click="showToast" >
				<view>
					<image src="../../static/qiandaox.png" mode="" class="images"></image>
					<p class="textA" >签到赠送积分</p>
						
				</view>
				<image src="../../static/向右箭头.png" mode=""></image>
			</view>

		</view>
		<u-toast ref="uToast" />

	</view>
</template>

<script>
	export default {
		data() {
			return {
				score:""
			}
		},
		mounted() {
			this.getThing()
		},
		methods: {
			getThing(){
				let that = this;
				uni.request({
					url:"https://api.it120.cc/xiaochengxu/user/amount?token="+that.token,
					type:"get",
					dataType: "json",
					data:{
						token:that.token
					},
					header:{
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					success: function(res) {
					      console.log(res)
						  that.score =res.data.data.score

					     }
				})
			},
			onLoad() {
			   let that =this
			   uni.getStorage({
			     key: 'token',
			     success: function(res) {
			      
			      console.log(res.data);
			      that.token = res.data
			     }
			    })
			   
			
			  },
			showToast() {
							this.$refs.uToast.show({
								message: '未开放:签到送积分',
								type: 'default',
								duration:1000
								// url: '/pages/user/index'
							})
						},
			goRule(){
				uni.navigateTo({
					url:'/pages/integralrule/integralrule'
				})
			},
			godeel(){
				uni.navigateTo({
					url:'/pages/deel/deel'
					
				})
			},
			goTransaction(){
			uni.navigateTo({
				url:'/pages/points/points'
			})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.top {
		height: 170rpx;
		background-image: linear-gradient(90deg, #6b6c85, #3a4053);
		display: flex;
		justify-content: space-between;
	}

	.top p {
		font-size: 25rpx;
		color: white;
		margin: 0rpx 20rpx;
		align-self: center;
	}

	.integral {
		height: 50rpx;
		width: 150rpx;
		background: rgba(0, 0, 0, .3);
		color: white;
		font-size: 25rpx;
		margin: 0rpx 20rpx;
		text-align: center;
		line-height: 50rpx;
		border-radius: 40rpx;
		align-self: center;
	}

	.cells {
		font-size: 26rpx;
		margin: 38rpx 10rpx;
		line-height: 38rpx;
		border-bottom: 1rpx solid #f2f3f5;
		display: flex;
		justify-content: space-between;
	}

	.cells view {
		display: flex;
	}

	.textA {
		align-self: center;
		font-size: 30rpx;
	}

	.cells image {
		height: 30rpx;
		width: 30rpx;
		margin: 20rpx;
	}

	.images {
		margin-top: 14rpx;
	}
</style>